Our international patent application WO 2007/000588 discloses an interface device for enabling wireless data communication between a host device and a remote device. The interface device has a host serial interface which is connected to the host device and a wireless interface for wireless data communication with the remote device. The interface device also has a wireless interface controller which is configured to control the operation of the wireless interface to enable data communication between the host device and the remote device via the interface device. A memory in the interface device stores a script based computer program and an interpreter reads successive program commands from the memory and converts the program commands into corresponding control commands for the wireless interface controller. The interface device has the advantage that the same script program may be used to operate interface devices using different wireless interface protocols simply by configuring the interpreter.
In a device of the kind described in WO 2007/000588, it is possible for the interpreter to process and execute each command of a stored source code computer program, such as a BASIC computer program. However, for the efficient use of the processing resources of the interface device, it is desirable to generate a compiled object code version of the computer program that can be interpreted more efficiently by the interpreter. In this way, it is not necessary for each command of the source code computer program to be interpreted each time the computer program is run. In general, this will increase the speed of operation of the computer program.
One possibility would be to compile the computer program on a host computer and upload a compiled version of the computer program to the interface device. In this case, the compiler on the host computer may require knowledge of how the commands of the computer program should be executed on the particular wireless interface controller to which the compiled version of the computer program e is to be uploaded. This can mean that the compiled version of the computer program is specific to the particular type of wireless interface controller. However, a major advantage of the device disclosed in WO 2007/000588 over devices such as the serial adapter disclosed in WO 2004/017575, is that the control commands for the wireless interface are independent of the protocol, e.g. Bluetooth, ZigBee, Wibree, Wi-Fi, IEEE 802.15.4 etc. that is used for wireless communication. If compilation is carried on a host computer, this independence is lost.
It is therefore desirable for any compiled version of the computer program to be generated on board the interface device. In this case, however, compilation must be carried out using the processing resources of the wireless interface controller. For reasons of cost and size, the processing resources of the wireless interface controller are likely to be significantly more limited than those of a typical personal computer, for example. In particular, providing random access memory on a wireless interface controller device is relatively expensive. It is therefore highly desirable to minimize the requirement for random access memory.
According to a typical prior art compilation process, during compilation a look-up table is maintained in memory which relates the variable names used in the computer program to the memory locations in which the values of those variables are stored. Sufficient memory must be provided to accommodate this look-up table, even where the program includes a large number of variables. Thus, according to the prior art, the provision of an onboard compiler in an interface device, such as that disclosed in WO 2007/000588, requires the provision of sufficient memory to maintain a variable look-up table during compilation. This amount of memory may not be required for any other purpose during operation of the interface device, which means that the provision of an onboard compiler may significantly increase the cost of the wireless controller device.
This invention seeks, at least in its preferred embodiments, to solve the problem of providing an onboard compiler in an interface device with limited available operating memory of the kind described in WO 2007/000588.